import type { PageParams } from "@/types/common"
import type { Role, RoleData, RoleDetail, RoleUserData } from "@/types/system"
import { request } from "@/utils/reuqest"

export const getRoleListAPI=()=>{
    return request<Role[]>('park/sys/role')
}
/**
 * 获取tree权限列表
 * @returns
 */
export const getTreeListAPI = ()=>{
    return request<RoleData[]>('/park/sys/permision/all/tree');

}
export const getRoleDetailAPI = (roleId: number) =>{
    return request<RoleDetail>(`/park/sys/role/${roleId}`)
}

/**
 * 获取角色成员列表
 * @returns
 */
export const getRoleUserAPI = (roleId: number, params?: PageParams) => {
    return request<RoleUserData>(`/park/sys/roleUser/${roleId}`, 'GET', params)
  }